import rtconfig
from building import *

cwd     = GetCurrentDir()
CPPPATH = [cwd, str(Dir('#'))]

src     = Glob('AT32F4xx_StdPeriph_Driver/src/*.c')
src += [cwd+'/CMSIS/CM4/DeviceSupport/startup/mdk/startup_at32f403zx_xl.s']
src += [cwd+'/CMSIS/CM4/DeviceSupport/system_at32f4xx.c']

include_path = [cwd+'/AT32F4xx_StdPeriph_Driver'+'/inc',
                cwd+'/CMSIS/CM4/CoreSupport',
                cwd+'/CMSIS/CM4/DeviceSupport',]

DEFINE = ['LIBRARY_VERSION','AT32F403Zx_XL']
group = DefineGroup('AT32F403_STD_Peripheral', src, depend = [''], CPPPATH = include_path,CPPDEFINES = DEFINE)

Return('group')
